package com.beerandjesus.sportofkings.handicapper.model;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Date: Jul 6, 2012
 * Time: 4:17:22 PM
 */
@Entity
@Table(name="jockey_rating")
public class JockeyRatingImpl implements JockeyRating, Serializable {

    @Id
    @Column(name="name")
    private String jockeyName;
    @Column(name="rating")
    @Enumerated(EnumType.STRING)
    private CramerJockeyRating rating;

    public String getJockeyName() {
        return jockeyName;
    }

    public void setJockeyName(String jockeyName) {
        this.jockeyName = jockeyName;
    }

    public CramerJockeyRating getRating() {
        return rating;
    }

    public void setRating(CramerJockeyRating rating) {
        this.rating = rating;
    }


    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        JockeyRatingImpl that = (JockeyRatingImpl) o;

        if (jockeyName != null ? !jockeyName.equals(that.jockeyName) : that.jockeyName != null) return false;
        return rating == that.rating;

    }

    public int hashCode() {
        int result;
        result = (jockeyName != null ? jockeyName.hashCode() : 0);
        result = 31 * result + (rating != null ? rating.hashCode() : 0);
        return result;
    }
}
